/* $Header: wkfutil.c,v 2.2 01/10/02 10:29:26 przybyls Exp $ */

/***********************************************************************/
/*                                                                     */
/*                  Copyright Hewlett-Packard Co. 1991                 */
/*                                                                     */
/***********************************************************************/

/***********************************************************************/
/* MODULE NAME: wkfutil.c                                              */
/* ============                                                        */
/*                                                                     */
/* Author:  Bob Cook                                                   */
/*                                                                     */
/* MODULE PURPOSE: This module contains workfile utilities.            */
/*                                                                     */
/*                                                                     */
/***********************************************************************/


/*****************************/
/*   GLOBAL INCLUDE FILES    */
/*****************************/

#include  <typedefs.h>
#include <string.h>
#include  <error.h>
#include  <p_wkfile.h>
#include  <wkfile.h>
#include  <ramps.h>
#include  <zone_config.h>
#include  <zone_status.h>
#include  <p_status.h>
#include  <status.h>
#include  <display.h>
#include  <p_ui.h>
#include  <valve_ui.h>
#include <det_ui.h>
#include  <zone_ui.h>
#include <mio.h>
#include <cmd_set.h>
#include <cmdproc.h>
#include <method.h>
#include <hostutil.h>
#include <wkfutil.h>
#include <i_op.h>

#include  <exception.h>
#include  <timetable.h>

#include  <std_ops.h>
#include  <set.h>

/*****************************/
/*   LOCAL INCLUDE FILES     */
/*****************************/



/*****************************/
/*   GLOBAL VARIABLES        */
/*****************************/


/*****************************/
/*   EXTERNAL VARIABLES      */
/*****************************/

extern  BIT8          *pIn_Msg;     /* ptr to next byte in msg for scanner */
extern  U_INT16        In_Msg_Len;  /* length of remaining message */

/*****************************/
/*   LOCAL DEFINES           */
/*****************************/


/*****************************/
/*   STATIC VARIABLES        */
/*****************************/

static TRUE_FALSE   UseCCIW(void);
static TRUE_FALSE   UseIFRC(void);
static TRUE_FALSE   UseIBRC(void);
static TRUE_FALSE   UseIFCW(void);
static TRUE_FALSE   UseIBCW(void);
static TRUE_FALSE   UseDFCW(void);
static TRUE_FALSE   UseDBCW(void);
static TRUE_FALSE   UseIFTW(void);
static TRUE_FALSE   UseIBTW(void);
static TRUE_FALSE   UseDFTW(void);
static TRUE_FALSE   UseDBTW(void);
static TRUE_FALSE   UseDFGW(void);
static TRUE_FALSE   UseDBGW(void);
static TRUE_FALSE   UseDFOW(void);
static TRUE_FALSE   UseDBOW(void);
static TRUE_FALSE   UseDFCO(void);
static TRUE_FALSE   UseDBCO(void);
static TRUE_FALSE   UseDFZW(void);
static TRUE_FALSE   UseDBZW(void);
static TRUE_FALSE   UseIFZW(void);
static TRUE_FALSE   UseIBZW(void);
static TRUE_FALSE   UseC1CW(void);
static TRUE_FALSE   UseC2CW(void);
static TRUE_FALSE   UseA1CW(void);
static TRUE_FALSE   UseA2CW(void);
static TRUE_FALSE   UseA1ZW(void);
static TRUE_FALSE   UseA2ZW(void);
static TRUE_FALSE   UseA3CW(void);
static TRUE_FALSE   UseA4CW(void);
static TRUE_FALSE   UseA5CW(void);
static TRUE_FALSE   UseV1CW(void);
static TRUE_FALSE   UseV2CW(void);
static TRUE_FALSE   UseV3CW(void);
static TRUE_FALSE   UseV4CW(void);
static TRUE_FALSE   UseV5CW(void);
static TRUE_FALSE   UseV6CW(void);
static TRUE_FALSE   UseV7CW(void);
static TRUE_FALSE   UseV8CW(void);
static TRUE_FALSE   UseOVCW(void);
static TRUE_FALSE   UseGCCW(void);
static TRUE_FALSE   UseASCW(void);
static TRUE_FALSE   UseCCCE(void);
static TRUE_FALSE   UseIFTR(void);
static TRUE_FALSE   UseIFTZ(void);
static TRUE_FALSE   UseIFCR(void);
static TRUE_FALSE   UseIFPP(void);
static TRUE_FALSE   UseIFDP(void);
static TRUE_FALSE   UseIFCP(void);
static TRUE_FALSE   UseIFSP(void);
static TRUE_FALSE   UseIFVP(void);
static TRUE_FALSE   UseIFGP(void);
static TRUE_FALSE   UseIFGV(void);
static TRUE_FALSE   UseIFVI(void);
static TRUE_FALSE   UseIFMS(void);
static TRUE_FALSE   UseIBTR(void);
static TRUE_FALSE   UseIBTZ(void);
static TRUE_FALSE   UseIBCR(void);
static TRUE_FALSE   UseIBPP(void);
static TRUE_FALSE   UseIBDP(void);
static TRUE_FALSE   UseIBCP(void);
static TRUE_FALSE   UseIBSP(void);
static TRUE_FALSE   UseIBVP(void);
static TRUE_FALSE   UseIBGP(void);
static TRUE_FALSE   UseIBGV(void);
static TRUE_FALSE   UseIBVI(void);
static TRUE_FALSE   UseIBMS(void);
static TRUE_FALSE   UseDFTR(void);
static TRUE_FALSE   UseDFTZ(void);
static TRUE_FALSE   UseDFNI(void);
static TRUE_FALSE   UseDFMF(void);
static TRUE_FALSE   UseDFFI(void);
static TRUE_FALSE   UseDFOI(void);
static TRUE_FALSE   UseDFOE(void);
static TRUE_FALSE   UseDFNT(void);
static TRUE_FALSE   UseDFOP(void);
static TRUE_FALSE   UseDFTC(void);
static TRUE_FALSE   UseDFNE(void);
static TRUE_FALSE   UseDFNU(void);
static TRUE_FALSE   UseDFNH(void);
static TRUE_FALSE   UseDFEC(void);
static TRUE_FALSE   UseDFNN(void);
static TRUE_FALSE   UseDFNP(void);
static TRUE_FALSE   UseDFNF(void);
static TRUE_FALSE   UseDFFP(void);
static TRUE_FALSE   UseDFAI(void);
static TRUE_FALSE   UseDFEI(void);
static TRUE_FALSE   UseDFUE(void);
static TRUE_FALSE   UseDFHI(void);
static TRUE_FALSE   UseDBTR(void);
static TRUE_FALSE   UseDBTZ(void);
static TRUE_FALSE   UseDBNI(void);
static TRUE_FALSE   UseDBMF(void);
static TRUE_FALSE   UseDBFI(void);
static TRUE_FALSE   UseDBOI(void);
static TRUE_FALSE   UseDBOE(void);
static TRUE_FALSE   UseDBNT(void);
static TRUE_FALSE   UseDBOP(void);
static TRUE_FALSE   UseDBTC(void);
static TRUE_FALSE   UseDBNE(void);
static TRUE_FALSE   UseDBNU(void);
static TRUE_FALSE   UseDBNH(void);
static TRUE_FALSE   UseDBEC(void);
static TRUE_FALSE   UseDBNN(void);
static TRUE_FALSE   UseDBNP(void);
static TRUE_FALSE   UseDBNF(void);
static TRUE_FALSE   UseDBFP(void);
static TRUE_FALSE   UseDBAI(void);
static TRUE_FALSE   UseDBEI(void);
static TRUE_FALSE   UseDBUE(void);
static TRUE_FALSE   UseDBHI(void);
static TRUE_FALSE   UseA1TR(void);
static TRUE_FALSE   UseA2TR(void);
static TRUE_FALSE   UseA1TZ(void);
static TRUE_FALSE   UseA2TZ(void);
static TRUE_FALSE   UseA1CR(void);
static TRUE_FALSE   UseA2CR(void);
static TRUE_FALSE   UseA3PR(void);
static TRUE_FALSE   UseA4PR(void);
static TRUE_FALSE   UseA5PR(void);
static TRUE_FALSE   UseC1NR(void);
static TRUE_FALSE   UseC2NR(void);
static TRUE_FALSE   UseIFNZ(void);
static TRUE_FALSE   UseIBNZ(void);
static TRUE_FALSE   UseDFNZ(void);
static TRUE_FALSE   UseDBNZ(void);
static TRUE_FALSE   UseA3NZ(void);
static TRUE_FALSE   UseA4NZ(void);
static TRUE_FALSE   UseA5NZ(void);
static TRUE_FALSE   UseCCC1(void);
static TRUE_FALSE   UseCCC2(void);
static TRUE_FALSE   UseGCPU(void);
static TRUE_FALSE   UseS1CS(void);
static TRUE_FALSE   UseS1CA(void);
static TRUE_FALSE   UseS1ZA(void);
static TRUE_FALSE   UseS2CS(void);
static TRUE_FALSE   UseS2CA(void);
static TRUE_FALSE   UseS2ZA(void);
static TRUE_FALSE   UseOVTR(void);
static TRUE_FALSE   UseOVTZ(void);
static TRUE_FALSE   UseOVSP(void);
static TRUE_FALSE   UseOVCR(void);
static TRUE_FALSE   UseGCPO(void);
static TRUE_FALSE   UseV1MP(void);
static TRUE_FALSE   UseV2MP(void);
static TRUE_FALSE   UseV3MP(void);
static TRUE_FALSE   UseV4MP(void);
static TRUE_FALSE   UseV5MP(void);
static TRUE_FALSE   UseV6MP(void);
static TRUE_FALSE   UseV7MP(void);
static TRUE_FALSE   UseV8MP(void);
static TRUE_FALSE   UseV1GS(void);
static TRUE_FALSE   UseV2GS(void);
static TRUE_FALSE   UseV3GS(void);
static TRUE_FALSE   UseV4GS(void);
static TRUE_FALSE   UseV5GS(void);
static TRUE_FALSE   UseV6GS(void);
static TRUE_FALSE   UseV7GS(void);
static TRUE_FALSE   UseV8GS(void);
static TRUE_FALSE   UseV1SW(void);
static TRUE_FALSE   UseV2SW(void);
static TRUE_FALSE   UseV3SW(void);
static TRUE_FALSE   UseV4SW(void);
static TRUE_FALSE   UseV5SW(void);
static TRUE_FALSE   UseV6SW(void);
static TRUE_FALSE   UseV7SW(void);
static TRUE_FALSE   UseV8SW(void);
static TRUE_FALSE   UseGCRD(void);
static TRUE_FALSE   UseGCRa(void);
static TRUE_FALSE   UseGCRb(void);
static TRUE_FALSE   UseGCRc(void);
static TRUE_FALSE   UseGCRd(void);
static TRUE_FALSE   UseGCRe(void);
static TRUE_FALSE   UseGCRf(void);
static TRUE_FALSE   UseGCRg(void);
static TRUE_FALSE   UseGCRh(void);
static TRUE_FALSE   UseGCRi(void);
static TRUE_FALSE   UseGCRj(void);
static TRUE_FALSE   UseGCRk(void);
static TRUE_FALSE   UseGCRl(void);
static TRUE_FALSE   UseGCRm(void);
static TRUE_FALSE   UseGCRn(void);
static TRUE_FALSE   UseGCRo(void);
static TRUE_FALSE   UseGCRp(void);
static TRUE_FALSE   UseGCRq(void);
static TRUE_FALSE   UseGCRr(void);
static TRUE_FALSE   UseGCRs(void);
static TRUE_FALSE   UseGCRt(void);
static TRUE_FALSE   UseGCRu(void);
static TRUE_FALSE   UseGCRv(void);
static TRUE_FALSE   UseGCRw(void);
static TRUE_FALSE   UseGCRx(void);
static TRUE_FALSE   UseGCRy(void);
static TRUE_FALSE   UseASTW(void);
static TRUE_FALSE   UseASTB(void);
static TRUE_FALSE   UseASTR(void);


/***********************************************************************/
/*                                                                     */
/* ORDER LIMITATIONS:                                                  */
/*          The order of these commands are important:                 */
/*             1) Configuration commands                               */
/*             2) Oven commands                                        */
/*             3) Inlet commands                                       */
/*             4) Detector thermal commands                            */
/*             5) Detector pneumatic commands                          */
/*             6) Dectector pneumatic on/off commands                  */
/*             7) Detector electronic commands                         */
/*             8) Aux commands                                         */
/*             9) Column commands                                      */
/*            10) Inlet pneumatic on/off commands                      */
/*            11) Aux pneumatic on/off commands                        */
/*            12) All ofther commands (including post values)          */
/*                                                                     */
/***********************************************************************/
static const BUILD_WF_ENTRY_TYPE Build_WF_Table[] =
{
    /* Use funct, GC  ,ALS ,Cmd Len, Cmd String */
        {UseCCIW, True, True,  8, "CCCCIW ?"},
        {UseIFRC, True, False, 8, "IFIFRC ?"},
        {UseIBRC, True, False, 8, "IBIBRC ?"},
        {UseDFMF, True, False, 8, "DFDFMF ?"},
        {UseDBMF, True, False, 8, "DBDBMF ?"},
        {UseIFTW, True, False, 8, "IFIFTW ?"},
        {UseIBTW, True, False, 8, "IBIBTW ?"},
        {UseDFTW, True, False, 8, "DFDFTW ?"},
        {UseDBTW, True, False, 8, "DBDBTW ?"},
        {UseDFGW, True, False, 8, "DFDFGW ?"},
        {UseDBGW, True, False, 8, "DBDBGW ?"},
        {UseDFOW, True, False, 8, "DFDFOW ?"},
        {UseDBOW, True, False, 8, "DBDBOW ?"},
        {UseDFCO, True, False, 8, "DFDFCO ?"},
        {UseDBCO, True, False, 8, "DBDBCO ?"},
        {UseDFZW, True, False, 8, "DFDFZW ?"},
        {UseDBZW, True, False, 8, "DBDBZW ?"},
        {UseIFZW, True, False, 8, "IFIFZW ?"},
        {UseIBZW, True, False, 8, "IBIBZW ?"},
        {UseA1ZW, True, False, 8, "A1A1ZW ?"},
        {UseA2ZW, True, False, 8, "A2A2ZW ?"},
        {UseIFCW, True, False, 8, "IFIFCW ?"},
        {UseIBCW, True, False, 8, "IBIBCW ?"},
        {UseDFCW, True, False, 8, "DFDFCW ?"},
        {UseDBCW, True, False, 8, "DBDBCW ?"},
        {UseC1CW, True, False, 8, "C1C1CW ?"},
        {UseC2CW, True, False, 8, "C2C2CW ?"},
        {UseA1CW, True, False, 8, "A1A1CW ?"},
        {UseA2CW, True, False, 8, "A2A2CW ?"},
        {UseA3CW, True, False, 8, "A3A3CW ?"},
        {UseA4CW, True, False, 8, "A4A4CW ?"},
        {UseA5CW, True, False, 8, "A5A5CW ?"},
        {UseV1CW, True, False, 8, "V1V1CW ?"},
        {UseV2CW, True, False, 8, "V2V2CW ?"},
        {UseV3CW, True, False, 8, "V3V3CW ?"},
        {UseV4CW, True, False, 8, "V4V4CW ?"},
        {UseV5CW, True, False, 8, "V5V5CW ?"},
        {UseV6CW, True, False, 8, "V6V6CW ?"},
        {UseV7CW, True, False, 8, "V7V7CW ?"},
        {UseV8CW, True, False, 8, "V8V8CW ?"},
        {UseOVCW, True, False, 8, "OVOVCW ?"},
        {UseGCCW, True, False, 8, "GCGCCW ?"},
        {UseASCW, False, True, 8, "ASASCW ?"},
        {UseCCCE, True, True,  8, "CCCCCE ?"},
        {UseOVTR, True, False, 8, "OVOVTR ?"},
        {UseOVTZ, True, False, 8, "OVOVTZ ?"},
        {UseOVSP, True, False, 8, "OVOVSP ?"},
        {UseOVCR, True, False, 8, "OVOVCR ?"},
        {UseGCPO, True, False, 8, "GCGCPO ?"},
        {UseIFTR, True, False, 8, "IFIFTR ?"},
        {UseIFTZ, True, False, 8, "IFIFTZ ?"},
        {UseIFCR, True, False, 8, "IFIFCR ?"},
        {UseIFPP, True, False, 8, "IFIFPP ?"},
        {UseIFDP, True, False, 8, "IFIFDP ?"},
        {UseIFCP, True, False, 8, "IFIFCP ?"},
        {UseIFSP, True, False, 8, "IFIFSP ?"},
        {UseIFVP, True, False, 8, "IFIFVP ?"},
        {UseIFGP, True, False, 8, "IFIFGP ?"},
        {UseIFGV, True, False, 8, "IFIFGV ?"},
        {UseIFVI, True, False, 8, "IFIFVI ?"},
        {UseIFMS, True, False, 8, "IFIFMS ?"},
        {UseIBTR, True, False, 8, "IBIBTR ?"},
        {UseIBTZ, True, False, 8, "IBIBTZ ?"},
        {UseIBCR, True, False, 8, "IBIBCR ?"},
        {UseIBPP, True, False, 8, "IBIBPP ?"},
        {UseIBDP, True, False, 8, "IBIBDP ?"},
        {UseIBCP, True, False, 8, "IBIBCP ?"},
        {UseIBSP, True, False, 8, "IBIBSP ?"},
        {UseIBVP, True, False, 8, "IBIBVP ?"},
        {UseIBGP, True, False, 8, "IBIBGP ?"},
        {UseIBGV, True, False, 8, "IBIBGV ?"},
        {UseIBVI, True, False, 8, "IBIBVI ?"},
        {UseIBMS, True, False, 8, "IBIBMS ?"},
        {UseDFTR, True, False, 8, "DFDFTR ?"},
        {UseDFTZ, True, False, 8, "DFDFTZ ?"},
        {UseDBTR, True, False, 8, "DBDBTR ?"},
        {UseDBTZ, True, False, 8, "DBDBTZ ?"},
        {UseDFNE, True, False, 8, "DFDFNE ?"},
        {UseDFNU, True, False, 8, "DFDFNU ?"},
        {UseDFNH, True, False, 8, "DFDFNH ?"},
        {UseDFNF, True, False, 8, "DFDFNF ?"},
        {UseDFNI, True, False, 8, "DFDFNI ?"},
        {UseDFNN, True, False, 8, "DFDFNN ?"},
        {UseDFNT, True, False, 8, "DFDFNT ?"},
        {UseDFOP, True, False, 8, "DFDFOP ?"},
        {UseDFNZ, True, False, 8, "DFDFNZ ?"},
        {UseDBNE, True, False, 8, "DBDBNE ?"},
        {UseDBNU, True, False, 8, "DBDBNU ?"},
        {UseDBNH, True, False, 8, "DBDBNH ?"},
        {UseDBNF, True, False, 8, "DBDBNF ?"},
        {UseDBNI, True, False, 8, "DBDBNI ?"},
        {UseDBNN, True, False, 8, "DBDBNN ?"},
        {UseDBNT, True, False, 8, "DBDBNT ?"},
        {UseDBOP, True, False, 8, "DBDBOP ?"},
        {UseDBNZ, True, False, 8, "DBDBNZ ?"},
        {UseDFAI, True, False, 8, "DFDFAI ?"},
        {UseDFEI, True, False, 8, "DFDFEI ?"},
        {UseDFEC, True, False, 8, "DFDFEC ?"},
        {UseDFUE, True, False, 8, "DFDFUE ?"},
        {UseDFHI, True, False, 8, "DFDFHI ?"},
        {UseDFFI, True, False, 8, "DFDFFI ?"},
        {UseDFOI, True, False, 8, "DFDFOI ?"},
        {UseDFOE, True, False, 8, "DFDFOE ?"},
        {UseDFFP, True, False, 8, "DFDFFP ?"},
        {UseDFNP, True, False, 8, "DFDFNP ?"},
        {UseDFTC, True, False, 8, "DFDFTC ?"},
        {UseDBAI, True, False, 8, "DBDBAI ?"},
        {UseDBEI, True, False, 8, "DBDBEI ?"},
        {UseDBEC, True, False, 8, "DBDBEC ?"},
        {UseDBUE, True, False, 8, "DBDBUE ?"},
        {UseDBHI, True, False, 8, "DBDBHI ?"},
        {UseDBFI, True, False, 8, "DBDBFI ?"},
        {UseDBOI, True, False, 8, "DBDBOI ?"},
        {UseDBOE, True, False, 8, "DBDBOE ?"},
        {UseDBFP, True, False, 8, "DBDBFP ?"},
        {UseDBNP, True, False, 8, "DBDBNP ?"},
        {UseDBTC, True, False, 8, "DBDBTC ?"},
        {UseA1TR, True, False, 8, "A1A1TR ?"},
        {UseA2TR, True, False, 8, "A2A2TR ?"},
        {UseA1TZ, True, False, 8, "A1A1TZ ?"},
        {UseA2TZ, True, False, 8, "A2A2TZ ?"},
        {UseA1CR, True, False, 8, "A1A1CR ?"},
        {UseA2CR, True, False, 8, "A2A2CR ?"},
        {UseA3PR, True, False, 8, "A3A3PR ?"},
        {UseA4PR, True, False, 8, "A4A4PR ?"},
        {UseA5PR, True, False, 8, "A5A5PR ?"},
        {UseC1NR, True, False, 8, "C1C1NR ?"},
        {UseC2NR, True, False, 8, "C2C2NR ?"},
        {UseIFNZ, True, False, 8, "IFIFNZ ?"},
        {UseIBNZ, True, False, 8, "IBIBNZ ?"},
        {UseA3NZ, True, False, 8, "A3A3NZ ?"},
        {UseA4NZ, True, False, 8, "A4A4NZ ?"},
        {UseA5NZ, True, False, 8, "A5A5NZ ?"},
        {UseCCC1, True, False, 8, "CCCCC1 ?"},
        {UseCCC2, True, False, 8, "CCCCC2 ?"},
        {UseGCPU, True, False, 8, "GCGCPU ?"},
        {UseS1CS, True, False, 8, "S1S1CS ?"},
        {UseS1CA, True, False, 8, "S1S1CA ?"},
        {UseS1ZA, True, False, 8, "S1S1ZA ?"},
        {UseS2CS, True, False, 8, "S2S2CS ?"},
        {UseS2CA, True, False, 8, "S2S2CA ?"},
        {UseS2ZA, True, False, 8, "S2S2ZA ?"},
        {UseV1MP, True, False, 8, "V1V1MP ?"},
        {UseV2MP, True, False, 8, "V2V2MP ?"},
        {UseV3MP, True, False, 8, "V3V3MP ?"},
        {UseV4MP, True, False, 8, "V4V4MP ?"},
        {UseV5MP, True, False, 8, "V5V5MP ?"},
        {UseV6MP, True, False, 8, "V6V6MP ?"},
        {UseV7MP, True, False, 8, "V7V7MP ?"},
        {UseV8MP, True, False, 8, "V8V8MP ?"},
        {UseV1GS, True, False, 8, "V1V1GS ?"},
        {UseV2GS, True, False, 8, "V2V2GS ?"},
        {UseV3GS, True, False, 8, "V3V3GS ?"},
        {UseV4GS, True, False, 8, "V4V4GS ?"},
        {UseV5GS, True, False, 8, "V5V5GS ?"},
        {UseV6GS, True, False, 8, "V6V6GS ?"},
        {UseV7GS, True, False, 8, "V7V7GS ?"},
        {UseV8GS, True, False, 8, "V8V8GS ?"},
        {UseV1SW, True, False, 8, "V1V1SW ?"},
        {UseV2SW, True, False, 8, "V2V2SW ?"},
        {UseV3SW, True, False, 8, "V3V3SW ?"},
        {UseV4SW, True, False, 8, "V4V4SW ?"},
        {UseV5SW, True, False, 8, "V5V5SW ?"},
        {UseV6SW, True, False, 8, "V6V6SW ?"},
        {UseV7SW, True, False, 8, "V7V7SW ?"},
        {UseV8SW, True, False, 8, "V8V8SW ?"},
        {UseGCRD, True, False, 8, "GCGCRD ?"},
        {UseGCRa, True, False, 8, "GCGCRa ?"},
        {UseGCRb, True, False, 8, "GCGCRb ?"},
        {UseGCRc, True, False, 8, "GCGCRc ?"},
        {UseGCRd, True, False, 8, "GCGCRd ?"},
        {UseGCRe, True, False, 8, "GCGCRe ?"},
        {UseGCRf, True, False, 8, "GCGCRf ?"},
        {UseGCRg, True, False, 8, "GCGCRg ?"},
        {UseGCRh, True, False, 8, "GCGCRh ?"},
        {UseGCRi, True, False, 8, "GCGCRi ?"},
        {UseGCRj, True, False, 8, "GCGCRj ?"},
        {UseGCRk, True, False, 8, "GCGCRk ?"},
        {UseGCRl, True, False, 8, "GCGCRl ?"},
        {UseGCRm, True, False, 8, "GCGCRm ?"},
        {UseGCRn, True, False, 8, "GCGCRn ?"},
        {UseGCRo, True, False, 8, "GCGCRo ?"},
        {UseGCRp, True, False, 8, "GCGCRp ?"},
        {UseGCRq, True, False, 8, "GCGCRq ?"},
        {UseGCRr, True, False, 8, "GCGCRr ?"},
        {UseGCRs, True, False, 8, "GCGCRs ?"},
        {UseGCRt, True, False, 8, "GCGCRt ?"},
        {UseGCRu, True, False, 8, "GCGCRu ?"},
        {UseGCRv, True, False, 8, "GCGCRv ?"},
        {UseGCRw, True, False, 8, "GCGCRw ?"},
        {UseGCRx, True, False, 8, "GCGCRx ?"},
        {UseGCRy, True, False, 8, "GCGCRy ?"},
        {UseASTW, False, True, 8, "ASASTW ?"},
        {UseASTB, False, True, 8, "ASASTB ?"},
        {UseASTR, False, True, 8, "ASASTR ?"},
};

#define BUILD_WF_TABLE_SIZE sizeof(Build_WF_Table)/sizeof(BUILD_WF_ENTRY_TYPE)

#  pragma SECTION UDATA=DRam
/* reserve space for upload buffers */
UPLD_WKFILE_TYPE    Upld_wkfile[4];
#  pragma SECTION UNDO


/*****************************/
/*   MACROS                  */
/*****************************/


/*****************************/
/*   IMPLEMENT SECTION       */
/*****************************/

/* METHOD COMMANDS
 *
 * DOWNLOAD:
 *        CmdProc()
 *            if(method command)
 *            {
 *                if(download)
 *                {
 *                    Load rest of packet into Dwnld_wkfile[chan] Buffer using
 *                         Append2WkFile
 *                              or
 *                         LoadHexCrc
 *                    DoCCMD returns control character B,C,orE
 *                }
 *            }
 *
 * INSTALL:
 *
 *   HOST COMMAND (CCMI):
 *     ExecuteWkFile  {miotask}   executes commands in workfile
 *
 *   INTERNAL SAVE METHOD:
 *     InstallWkFile  {non miotask}    initiates ExecuteWkFile() by setting
 *                                           request flag
 *     CheckAndExecInstallWkFile {miotask}  checks for request,executes wrkfile
 *                                          and sets done
 *        ExecuteWkFile  {miotask}   executes commands in workfile
 *
 * UPLOAD:
 *
 *   HOST COMMAND (CCMD):
 *     DoCCMD()
 *       BuildWkFile makes workfile.
 *         CreateWkFileEntry()  creates one workfile entry.
 *
 *   INTERNAL SAVE METHOD:
 *     CreateWkfile  {non miotask}    initiates ExecuteWkFile() by setting
 *                                           request flag
 *     CheckAndExecCreateWkFile {miotask}  checks for request and sets done
 *     MakeWkFile  {miotask}   setup and calls BuildWkFile
 *       BuildWkFile makes workfile.
 *         CreateWkFileEntry()  creates one workfile entry.
 *
 */

/*****************  WORKFILE INSTALL FUNCTIONS  ************************/

/***********************************************************************/
/* FUNCTION: InstallWkFile                                             */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Used by any process to initiate a workfile install.        */
/*          It will execute ExecuteWkFile if its executed from         */
/*          MIO Command Task.                                          */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/

void InstallWkFile(BIT8  *p_begin, U_INT16 length, U_INT16 chan)
{
   Dwnld_wkfile[chan].p_install_begin = p_begin;
   Dwnld_wkfile[chan].install_len = length;
   /* execute ExecuteWkFile from MIOCommandTask only */
   if( (TASK_Get_MyName()) == (MAKESTR('M','I','O','C')) )
   {
      ExecuteWkFile(Dwnld_wkfile[chan].p_install_begin,Dwnld_wkfile[chan].install_len);
   }
   else
   {
      Dwnld_wkfile[chan].install_request = TRUE;
      /* yield until workfile is installed */
      while (Dwnld_wkfile[chan].install_done == FALSE)
      {
         Task_yield();
      }
      Dwnld_wkfile[chan].install_done = FALSE;
   }
}
/***********************************************************************/
/* END: InstallWkFile                                                  */
/***********************************************************************/

/***********************************************************************/
/* FUNCTION: CheckAndExecInstallWkFile                                 */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Checks if someone is requesting a workfile install,        */
/*          if so, it initiates an ExecuteWkFile.                      */
/*          Runs in miotask.                                           */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/
void CheckAndExecInstallWkFile(U_INT16 chan)
{
   if(Dwnld_wkfile[chan].install_request == TRUE)
   {
      Dwnld_wkfile[chan].install_request = FALSE;
      ExecuteWkFile(Dwnld_wkfile[chan].p_install_begin,Dwnld_wkfile[chan].install_len);
      Dwnld_wkfile[chan].install_done = TRUE;
   }
}


/*******************  WORKFILE CRC FUNCTIONS  **************************/

/***********************************************************************/
/* FUNCTION: CrcWkfile                                               */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Calculates the CRC of the workfile and converts it to a    */
/*          hexadecimal number.                                        */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/
void CrcWkfile(BIT8  *p_begin, U_INT16 length,BIT8  *hex_crc)
{
U_INT32 num;
   num = crc16(p_begin,length);
   (void)FormatHexadecimal(num,hex_crc,(U_INT8)-4);
}
/***********************************************************************/
/* END FUNCTION: CrcWkfile                                             */
/***********************************************************************/

/***********************************************************************/
/* FUNCTION: CheckWkfileCrc                                            */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Check if crc exits by testing for the string "NONE".       */
/*          If a CRC exists it will calculate the CRC for the          */
/*          downloaded or stored workfile and compare it to            */
/*          the workfiles hexadecimal CRC.                             */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/

UI_ERR  CheckWkfileCrc(BIT8  *p_begin, U_INT16 length, BIT8  *hex_crc)
{
BIT8   ptmp_crc[5];
   if(StrNCmp(hex_crc,(BIT8  *)"NONE",4))
   {
      return OK;
   }
   else
   {
      CrcWkfile(p_begin,length,ptmp_crc);
      if(StrNCmp(ptmp_crc,hex_crc,4))
      {
         return OK;
      }
      else
      {
         return NOT_COMPATIBLE;
      }
   }
}
/***********************************************************************/
/* END FUNCTION: CheckWkfileCrc                                        */
/***********************************************************************/


/***************  WORKFILE UPLOAD OR STORE FUNCTIONS  ******************/

/***********************************************************************/
/* FUNCTION: CreateWkfile                                              */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Used by any process to create a workfile. If function      */
/*       is called from MIO Command Task it will call MakeWkfile       */
/*       directly, otherwise it will signal CheckAndExecCreateWkFile   */
/*       to initiate MakeWkfile.                                       */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/

INT16 CreateWkfile(BIT8  *p_begin, U_INT16 max_length,BIT8  *crc_loc,
                           WKFILE_CONTENTS wkfile_contents,U_INT16 chan)
{
   Upld_wkfile[chan].p_buffer = p_begin;
   Upld_wkfile[chan].max_len = max_length;
   Upld_wkfile[chan].crc_loc = crc_loc;
   Upld_wkfile[chan].contents = wkfile_contents;
   /* execute MakeWkfile from MIOCommandTask only */
   if( (TASK_Get_MyName()) == (MAKESTR('M','I','O','C')) )
   {
      Upld_wkfile[chan].successful=MakeWkfile(Upld_wkfile[chan].p_buffer,
      Upld_wkfile[chan].max_len,Upld_wkfile[chan].crc_loc,Upld_wkfile[chan].contents,chan);
   }
   else
   {
      Upld_wkfile[chan].create_request = TRUE;
      /* yield until workfile is created */
      while (Upld_wkfile[chan].create_done == FALSE)
      {
         Task_yield();
      }
      Upld_wkfile[chan].create_done = FALSE;
   }
   if(Upld_wkfile[chan].successful == TRUE)
   {
      return Upld_wkfile[chan].length;
   }
   else
   {
      return -1;
   }
}

/***********************************************************************/
/* FUNCTION: CheckAndExecCreateWkFile                                 */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Checks if someone is requesting to create a workfile,      */
/*          if so, it initiates CreateWkFile.                          */
/*          Runs in miotask.                                           */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/
void CheckAndExecCreateWkFile(void)
{
U_INT16 chan;

   for (chan = 0; chan <= 3; chan++)
   {
      if(Upld_wkfile[chan].create_request == TRUE)
      {
         Upld_wkfile[chan].create_request = FALSE;
         Upld_wkfile[chan].successful=MakeWkfile(Upld_wkfile[chan].p_buffer,
              Upld_wkfile[chan].max_len, Upld_wkfile[chan].crc_loc, Upld_wkfile[chan].contents,chan);
         Upld_wkfile[chan].create_done = TRUE;
      }
   }
}

/***********************************************************************/
/* FUNCTION: MakeWkfile                                                */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Used to create a workfile.  This fuction should not be     */
/*     called directly.  Use CreateWkFile().                           */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/

BIT8 MakeWkfile(BIT8  *p_begin, U_INT16 max_length,BIT8  *crc_loc,
         WKFILE_CONTENTS wkfile_contents, U_INT16 chan)
{
   /* start with first part of workfile */

#if 0
   if(HaveAlsPowerSupply())
   {
      /* notify ALS task to get sampler workfile wait for resp */
      UpdateAlsWkfile(READ_WKFILE);
   }
#endif

   /* build workfile in Upld_wkfile[chan] structure */
   BuildWkFile(Upld_wkfile[chan].buffer, crc_loc, wkfile_contents, chan);

   /* if p_begin == Upld_wkfile[chan].buffer - do not copy workfile */
   if (p_begin == Upld_wkfile[chan].buffer)
   {
      return TRUE;
   }
   else
   {
      if( (p_begin!=Upld_wkfile[chan].buffer) && (Upld_wkfile[chan].length<max_length) )
      {

         (void)memcpy(p_begin,Upld_wkfile[chan].buffer,Upld_wkfile[chan].length);
         return  TRUE;
      }
      else
      {
         return  FALSE;
      }
   }
}
/***********************************************************************/
/* END FUNCTION: MakeWkfile                                            */
/***********************************************************************/




/***********************************************************************/
/* FUNCTION: CreateWkFileEntry                                         */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: create a single workfile entry.  Using "msg" for input     */
/*           string and puts response at Internal_Buffer location.     */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/

void CreateWkFileEntry(IN_MSG_CB_TYPE   *msg)
{
 UI_ERR     error;
 CMD_TYPE  *p_cmd;
 U_INT16    before_length;

   /* check if input message and if there is a cmd buf available for Scan */
   while((*msg).in_msg_len != 0)
   {
      INTERRUPTS_OFF;
      if (Free_Cmd_Q.num_entries != 0)
      {
         GetCmdSafe(p_cmd, Free_Cmd_Q);
         INTERRUPTS_ON;

         /* set up command buffer header to indicate source of command */
         p_cmd->comm_port = INTERNAL_BUFFER ;

         before_length = Internal_Buffer.length;

         error =  Scan(msg,p_cmd);
         CleanUpMsg(msg);
         if( !error )
         {
            switch (p_cmd->dsap.int_dsap)
            {
/*-------------changed by wangwei---------------*/
printf("call CreateWkFileEntry\n");
/*
            case  MAKEINT('G','C'):
               ExecWkfileCmds(p_cmd,GCOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case  MAKEINT('S','1'):
               ExecWkfileCmds(p_cmd,S1Opcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('S','2'):
               ExecWkfileCmds(p_cmd,S2Opcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('S','S'):
               ExecWkfileCmds(p_cmd,SSOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('C','C'):
               ExecWkfileCmds(p_cmd,CCOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('O','V'):
               ExecWkfileCmds(p_cmd,OVOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('I','F'):
            case MAKEINT('I','B'):
               ExecWkfileCmds(p_cmd,IXOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('D','F'):
            case MAKEINT('D','B'):
               ExecWkfileCmds(p_cmd,DXOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('C','1'):
            case MAKEINT('C','2'):
               ExecWkfileCmds(p_cmd,CXOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('A','1'):
            case MAKEINT('A','2'):
            case MAKEINT('A','3'):
            case MAKEINT('A','4'):
            case MAKEINT('A','5'):
               ExecWkfileCmds(p_cmd,AXOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('V','1'):
            case MAKEINT('V','2'):
            case MAKEINT('V','3'):
            case MAKEINT('V','4'):
            case MAKEINT('V','5'):
            case MAKEINT('V','6'):
            case MAKEINT('V','7'):
            case MAKEINT('V','8'):
            case MAKEINT('V','X'):
               ExecWkfileCmds(p_cmd,VXOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('A','S'):
               ExecWkfileCmds(p_cmd,ASOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            case MAKEINT('D','T'):
               ExecWkfileCmds(p_cmd,DTOpcodes);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
*/
/*-------end change---------------------*/
            default:
               /* ERROR: DESTINATION NOT VALID */
               /* ignore command */
               error = INVALID_DEST;
               CmdErrorHandler(p_cmd, 0, error);
               AppendCmd(p_cmd, Free_Cmd_Q);
               break;
            } /* switch (p_cmd->dsap.int_dsap) */

            /* if this command gave response, add ; seperator */
            if(Internal_Buffer.length != before_length )
            {
               /* seperate each command with a ';' */
               *Internal_Buffer.p_buffer++ = ';';
               Internal_Buffer.length++;
            }


         } /* if(!error) */
         else
         {
            /* ERROR: BAD INSTRUCTION */
            CmdErrorHandler(p_cmd, 0, error);
            AppendCmd(p_cmd, Free_Cmd_Q);
         }
      }   /* if (Free_Cmd_Q.num_entries != 0) ) */
      else
      {
         INTERRUPTS_ON;
         (void)ProcessCmds();
      }

   }   /*  while( (in_msg_len != 0) */
}
/***********************************************************************/
/* END FUNCTION: CreateWkFileEntry                                     */
/***********************************************************************/



/***********************************************************************/
/* FUNCTION: UpldWFEntrySize                                           */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Gives the size of the requested entry in the workfile.     */
/*             Uses data structor Upld_wkfile[chan].                         */
/*                                                                     */
/* RETURNED VALUE: size of entry                                       */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/
U_INT16 UpldWFEntrySize(U_INT16 entry, U_INT16 chan)
{
   return   Upld_wkfile[chan].p_entry[entry+1] - Upld_wkfile[chan].p_entry[entry];
}

/***********************************************************************/
/* FUNCTION: BuildWkFile                                               */
/* ========                                                            */
/*                                                                     */
/* PURPOSE: Create a workfile for uploading or for internal storage.   */
/*                                                                     */
/* RETURNED VALUE: none                                                */
/*                                                                     */
/* LIMITATIONS:                                                        */
/*                                                                     */
/* WARNINGS:                                                           */
/*                                                                     */
/***********************************************************************/
/*
 *     Build_WF_Table:
 *     -----------------------------------------------------------------
 *     | UseFunctionPtr | GC_Param | ALS_Param | SizeOfCmdStr | CmdStr |
 *     -----------------------------------------------------------------
 *
 *
 *     Internal_Buffer:
 *     -------------------------------------------------------------
 *     |                    ;                          ;      ;
 *     -------------------------------------------------------------
 *      ^                   ^                          ^
 *      |                   |                          |
 *   Upld_wkfile[chan].p_entry[0] Upld_wkfile[chan].p_entry[1]     Upld_wkfile[chan].p_entry[2]
 *
 *
 */

void BuildWkFile(BIT8 *wf_loc,BIT8 *crc_loc,WKFILE_CONTENTS wkfile_contents,U_INT16 chan)
{
U_INT16 table_index,wf_entry;

   table_index = 0;
   wf_entry = 0;

   /* setup INTERNAL BUFFER for command responses */
   Internal_Buffer.p_buffer = wf_loc;
   Internal_Buffer.length = 0;

   for( table_index = 0; table_index < BUILD_WF_TABLE_SIZE; table_index++)
   {
     if( (Build_WF_Table[table_index].UseCmd() == True) &&
      ((wkfile_contents==GC_ONLY&&Build_WF_Table[table_index].gc_param==True) ||
      (wkfile_contents==ALS_ONLY&&Build_WF_Table[table_index].als_param==True)||
      (wkfile_contents == BOTH) ) )
     {

         /* save the begining point of the entry (for uploading only) */
         Upld_wkfile[chan].p_entry[wf_entry] = Internal_Buffer.p_buffer;

         /* setup variables for Scan */
         Wkfile_CB.pin_msg = (BIT8 *)Build_WF_Table[table_index].cmd_string;
         Wkfile_CB.in_msg_len = Build_WF_Table[table_index].cmd_size;
         CreateWkFileEntry(&Wkfile_CB);
         Upld_wkfile[chan].p_entry[wf_entry+1] = Internal_Buffer.p_buffer;
         wf_entry++;
      }
   }
   /* set up data structure */
   Upld_wkfile[chan].total_entries = wf_entry;
   Upld_wkfile[chan].p_buffer = Internal_Buffer.p_buffer;
   Upld_wkfile[chan].length = Internal_Buffer.length;

   /* determine crc */
   CrcWkfile(Upld_wkfile[chan].buffer,Upld_wkfile[chan].length,crc_loc);



}





/************  FUNCTIONS USED TO BUILD A WORKFILE  *****************/


/************* INFO ABOUT GC CREATING WORKFILE ***************/
/**************** NAME,SERIAL #,REV,TIME,DATE ****************/
static TRUE_FALSE   UseCCIW(void)
{
   return True;
}
static TRUE_FALSE   UseIFRC(void)
{
   switch ( GetInletType(pFRONT_INLET) )
   {
   case PP:
   case COC:
   case SS:
   case PTV:
   case CIS3:
   case CIS4:
   case VOLATILES:
   case SIMDIST:
      return True;

   default:
     return False;
   }
}

/******** PNUEMATICS CONVERSION FACTORS FROM SOURCE GC *******/
static TRUE_FALSE   UseIBRC(void)
{
   switch ( GetInletType(pBACK_INLET) )
   {
   case PP:
   case COC:
   case SS:
   case PTV:
   case CIS3:
   case CIS4:
   case VOLATILES:
   case SIMDIST:
      return True;

   default:
     return False;
   }
}

/********************* GC CONFIGURATION **********************/
static TRUE_FALSE   UseIFCW(void)
{
   return True;
}
static TRUE_FALSE   UseIBCW(void)
{
   return True;
}
static TRUE_FALSE   UseDFCW(void)
{
   return True;
}
static TRUE_FALSE   UseDBCW(void)
{
   return True;
}
static TRUE_FALSE   UseC1CW(void)
{
   return True;
}
static TRUE_FALSE   UseC2CW(void)
{
   return True;
}
static TRUE_FALSE   UseA1CW(void)
{
   return True;
}
static TRUE_FALSE   UseA2CW(void)
{
   return True;
}
static TRUE_FALSE   UseDFZW(void)
{
   DET_TYPE det;

   det = GetDetectorType(FRONT);

   return (((det == FPD) ||
             GetZoneUserLimitsChanged(pFRONT_DET_TEMP)) ? True : False );
}
static TRUE_FALSE   UseDBZW(void)
{
   DET_TYPE det;

   det = GetDetectorType(BACK);

   return (((det == FPD) ||
             GetZoneUserLimitsChanged(pBACK_DET_TEMP)) ? True : False );
}
static TRUE_FALSE   UseIFZW(void)
{
   INLET_TYPE inlet;

   inlet = GetInletType( pFRONT_INLET );

   return ((( inlet == CIS4 ) ||
            ( inlet == VOLATILES ) ||
            ( inlet == SIMDIST ) ||
            GetZoneUserLimitsChanged( pFRONT_INLET_TEMP)) ? True : False );
}
static TRUE_FALSE   UseIBZW(void)
{
   INLET_TYPE inlet;

   inlet = GetInletType( pBACK_INLET );

   return ((( inlet == CIS4 ) ||
            ( inlet == VOLATILES ) ||
            ( inlet == SIMDIST ) ||
            GetZoneUserLimitsChanged( pBACK_INLET_TEMP)) ? True : False );
}
static TRUE_FALSE   UseA1ZW(void)
{
   return ( ((GetAuxType( 1 ) == CRYO_TRAP) ||
             GetZoneUserLimitsChanged( pAUX_1_TEMP)) ? True : False );
}
static TRUE_FALSE   UseA2ZW(void)
{
   return ( ((GetAuxType( 2 ) == CRYO_TRAP) ||
             GetZoneUserLimitsChanged( pAUX_2_TEMP)) ? True : False );
}
static TRUE_FALSE   UseA3CW(void)
{
   return True;
}
static TRUE_FALSE   UseA4CW(void)
{
   return True;
}
static TRUE_FALSE   UseA5CW(void)
{
   return True;
}
static TRUE_FALSE   UseV1CW(void)
{
   return True;
}
static TRUE_FALSE   UseV2CW(void)
{
   return True;
}
static TRUE_FALSE   UseV3CW(void)
{
   return True;
}
static TRUE_FALSE   UseV4CW(void)
{
   return True;
}
static TRUE_FALSE   UseV5CW(void)
{
   return True;
}
static TRUE_FALSE   UseV6CW(void)
{
   return True;
}
static TRUE_FALSE   UseV7CW(void)
{
   return True;
}
static TRUE_FALSE   UseV8CW(void)
{
   return True;
}
static TRUE_FALSE   UseOVCW(void)
{
   return True;
}
static TRUE_FALSE   UseGCCW(void)
{
   return True;
}

/********************* ALS CONFIGURATION *********************/
static TRUE_FALSE   UseASCW(void)
{
   return True;
}
static TRUE_FALSE   UseCCCE(void)
{
   return True;
}

/******************** BEGIN GC SETPOINTS *********************/
/******************* FRONT INLET COMMANDS ********************/
static TRUE_FALSE   UseIFTR(void)
{
   return ( GetInletType(pFRONT_INLET) != NO_INLET ) ? True : False;
}
static TRUE_FALSE   UseIFTZ(void)
{
   return ( GetInletType(pFRONT_INLET) != NO_INLET ) ? True : False;
}
static TRUE_FALSE   UseIFPP(void)
{
   return (GetInletType(pFRONT_INLET) == PP)  ? True : False;
}
static TRUE_FALSE   UseIFDP(void)
{
   return  ( GetInletType(pFRONT_INLET) == SIMDIST ) ? True : False;
}
static TRUE_FALSE   UseIFCP(void)
{
   return  (GetInletType(pFRONT_INLET) == COC)  ? True : False;
}
static TRUE_FALSE   UseIFSP(void)
{
   return  ( GetInletType(pFRONT_INLET) == SS ) ? True : False;
}
static TRUE_FALSE   UseIFVP(void)
{
   return  ( GetInletType(pFRONT_INLET) == PTV) ? True : False;
}
static TRUE_FALSE   UseIFGP(void)
{
   return  ( GetInletType(pFRONT_INLET) == CIS3 ) ? True : False;
}
static TRUE_FALSE   UseIFGV(void)
{
   return  ( GetInletType(pFRONT_INLET) == CIS4) ? True : False;
}
static TRUE_FALSE   UseIFVI(void)
{
   return  ( GetInletType(pFRONT_INLET) == VOLATILES) ? True : False;
}
static TRUE_FALSE   UseIFMS(void)
{
   return  ( GetInletType(pFRONT_INLET) == MANUAL_SS ) ? True : False;
}

/******************* BACK INLET COMMANDS *********************/
static TRUE_FALSE   UseIBTR(void)
{
   return  ( GetInletType(pBACK_INLET) != NO_INLET ) ? True : False;
}
static TRUE_FALSE   UseIBTZ(void)
{
   return  ( GetInletType(pBACK_INLET) != NO_INLET ) ? True : False;
}
static TRUE_FALSE   UseIBPP(void)
{
     return  (GetInletType(pBACK_INLET) == PP) ? True : False;
}
static TRUE_FALSE   UseIBDP(void)
{
   return  ( GetInletType(pBACK_INLET) == SIMDIST ) ? True : False;
}
static TRUE_FALSE   UseIBCP(void)
{
   return  (GetInletType(pBACK_INLET) == COC) ? True : False;
}
static TRUE_FALSE   UseIBSP(void)
{
   return  ( GetInletType(pBACK_INLET) == SS ) ? True : False;
}
static TRUE_FALSE   UseIBVP(void)
{
   return  ( GetInletType(pBACK_INLET) == PTV) ? True : False;
}
static TRUE_FALSE   UseIBGP(void)
{
   return  ( GetInletType(pBACK_INLET) == CIS3 ) ? True : False;
}
static TRUE_FALSE   UseIBGV(void)
{
   return  ( GetInletType(pBACK_INLET) == CIS4) ? True : False;
}
static TRUE_FALSE   UseIBVI(void)
{
   return  ( GetInletType(pBACK_INLET) == VOLATILES) ? True : False;
}
static TRUE_FALSE   UseIBMS(void)
{
   return  ( GetInletType(pBACK_INLET) == MANUAL_SS ) ? True : False;
}

/******************* FRONT DETECTOR COMMANDS *****************/
static TRUE_FALSE   UseDFTR(void)
{
   return (GetTempZonePresence(pFRONT_DET_TEMP) == ZONE_PRESENT) ? True : False;

}
static TRUE_FALSE   UseDFTZ(void)
{
   return (GetTempZonePresence(pFRONT_DET_TEMP) == ZONE_PRESENT) ? True : False;
}
static TRUE_FALSE   UseDFNI(void)
{
  /* if EPC FID detector or CPF pneu */

   return  ( ((GetDetectorType(FRONT)==FID) && EpcDetector(pFRONT_DETECTOR)) ||
              GetCPFDetPneuPresence( FRONT )) ? True : False;

}
static TRUE_FALSE   UseDFMF(void)
{
   if (0 == EpcDetector(pFRONT_DETECTOR)) return False;
   if ( (GetDetectorType(FRONT)!=OEM_AIB) && (GetDetectorType(FRONT)!=OEM_FID) ) return True;
   return (TRUE_FALSE)(DetectorA_Config.host_model == TYPE_13_14_AS_IS ) ;
}
static TRUE_FALSE   UseIFTW(void)
{
   return  (TRUE_FALSE)GetCPFInletTitlePresence( FRONT );
}
static TRUE_FALSE   UseDFTW(void)
{
   if ( GetCPFDetTitlePresence( FRONT ) ) return True ;
   return (
           ((GetDetectorType(FRONT)==OEM_AIB)||(GetDetectorType(FRONT)==OEM_FID)) &&
           ( GetDetType(pFRONT_DETECTOR)==EPC_OEM )
          )  ? True : False;
}
static TRUE_FALSE   UseDFGW(void)
{
   return  (TRUE_FALSE)GetCPFDetPneuPresence( FRONT );
}
static TRUE_FALSE   UseDFOW(void)
{
   return  (TRUE_FALSE)GetCPFOIMPresence( FRONT );
}
static TRUE_FALSE   UseDFCO(void)
{
   return (
           (DetectorA_Config.host_model == TYPE_13_14_AS_IS)  &&
           ((GetDetectorType(FRONT)==OEM_AIB)||(GetDetectorType(FRONT)==OEM_FID)) &&
           (GetDetType(pFRONT_DETECTOR)==EPC_OEM )
          ) ? True : False;
}
static TRUE_FALSE   UseDFFI(void)
{
  return((GetDetectorType(FRONT)==FID)&&!GetElectrometerType(FRONT))?True:False;
}
static TRUE_FALSE   UseDFOI(void)
{
   return  (TRUE_FALSE)GetCPFOIMPresence( FRONT );
}
static TRUE_FALSE   UseDFOE(void)
{
   return UseDFCO() ;

}
static TRUE_FALSE   UseDFNT(void)
{
   return  ( (GetDetectorType(FRONT)==TCD) && EpcDetector(pFRONT_DETECTOR) ) ?
                       True : False;
}
static TRUE_FALSE   UseDFOP(void)
{
   return UseDFCO() ;
}
static TRUE_FALSE   UseDFTC(void)
{
   return  ( GetDetectorType(FRONT) == TCD ) ? True : False;
}
static TRUE_FALSE   UseDFNE(void)
{
   return  ( (GetDetectorType(FRONT)==ECD) && EpcDetector(pFRONT_DETECTOR) ) ?
                   True : False;
}
static TRUE_FALSE   UseDFNU(void)
{
   return  ( (GetDetectorType(FRONT)==uECD) && EpcDetector(pFRONT_DETECTOR) ) ?
                   True : False;
}
static TRUE_FALSE   UseDFNH(void)
{
   return  ( (GetDetectorType(FRONT)==LDID) && EpcDetector(pFRONT_DETECTOR) ) ?
                   True : False;
}
static TRUE_FALSE   UseDFEC(void)
{
   return  ( GetDetectorType(FRONT) == ECD ) ? True : False;
}
static TRUE_FALSE   UseDFNN(void)
{
   return  ( (GetDetectorType(FRONT)==NPD) && EpcDetector(pFRONT_DETECTOR) ) ?
                 True : False;
}
static TRUE_FALSE   UseDFNP(void)
{
   return  ( GetDetectorType(FRONT) == NPD ) ? True : False;
}
static TRUE_FALSE   UseDFNF(void)
{
   return  ( (GetDetectorType(FRONT)==FPD) && EpcDetector(pFRONT_DETECTOR) ) ?
                  True : False;
}
static TRUE_FALSE   UseDFFP(void)
{
   return  ( GetDetectorType(FRONT) == FPD ) ? True : False;
}
static TRUE_FALSE   UseDFAI(void)
{
   if ( GetDetectorType(FRONT) == AIB ) return True ;
   if ( (GetDetectorType(FRONT)==OEM_AIB) || (GetDetectorType(FRONT)==OEM_FID) )
   {
      return (TRUE_FALSE)(DetectorA_Config.host_model == TYPE_13_14_AS_AIB ) ;
   };
   return False;
}

static TRUE_FALSE   UseDFEI(void)
{
   return  ( GetElectrometerType(FRONT) ) ? True : False;
}

static TRUE_FALSE   UseDFUE(void)
{
   return  ( GetDetectorType(FRONT) == uECD ) ? True : False;
}

static TRUE_FALSE   UseDFHI(void)
{
   return  ( GetDetectorType(FRONT) == LDID ) ? True : False;
}

/****************** BACK DETECTOR COMMANDS *******************/
static TRUE_FALSE   UseDBTR(void)
{
   return  (GetTempZonePresence(pBACK_DET_TEMP) == ZONE_PRESENT) ? True : False;
}
static TRUE_FALSE   UseDBTZ(void)
{
   return  (GetTempZonePresence(pBACK_DET_TEMP) == ZONE_PRESENT) ? True : False;
}
static TRUE_FALSE   UseDBMF(void)
{
   if (0 == EpcDetector(pBACK_DETECTOR)) return False;
   if ( (GetDetectorType(BACK)!=OEM_AIB) && (GetDetectorType(BACK)!=OEM_FID) ) return True;
   return (TRUE_FALSE)(DetectorB_Config.host_model == TYPE_13_14_AS_IS ) ;
}
static TRUE_FALSE   UseIBTW(void)
{
   return  (TRUE_FALSE)GetCPFInletTitlePresence( BACK );
}
static TRUE_FALSE   UseDBTW(void)
{
   if ( GetCPFDetTitlePresence( BACK ) ) return True ;
   return (
           ((GetDetectorType(BACK)==OEM_AIB)||(GetDetectorType(BACK)==OEM_FID)) &&
           ( GetDetType(pBACK_DETECTOR)==EPC_OEM )
          )  ? True : False;
}
static TRUE_FALSE   UseDBGW(void)
{
   return  (TRUE_FALSE)GetCPFDetPneuPresence( BACK );
}
static TRUE_FALSE   UseDBOW(void)
{
   return  (TRUE_FALSE)GetCPFOIMPresence( BACK );
}
static TRUE_FALSE   UseDBCO(void)
{
   return (
           (DetectorB_Config.host_model == TYPE_13_14_AS_IS)  &&
           ((GetDetectorType(BACK)==OEM_AIB)||(GetDetectorType(BACK)==OEM_FID)) &&
           (GetDetType(pBACK_DETECTOR)==EPC_OEM )
          ) ? True : False;
}
static TRUE_FALSE   UseDBNI(void)
{
  /* if EPC FID detector or CPF pneu */
   return  ( ((GetDetectorType(BACK)==FID) && EpcDetector(pBACK_DETECTOR)) ||
              GetCPFDetPneuPresence( BACK )) ? True : False;
}
static TRUE_FALSE   UseDBFI(void)
{
   return ((GetDetectorType(BACK)==FID)&&!GetElectrometerType(BACK))?True:False;
}
static TRUE_FALSE   UseDBOI(void)
{
   return  (TRUE_FALSE)GetCPFOIMPresence( BACK );
}
static TRUE_FALSE   UseDBOE(void)
{
   return  UseDBCO() ;
}
static TRUE_FALSE   UseDBNT(void)
{
   return  ( (GetDetectorType(BACK)==TCD) && EpcDetector(pBACK_DETECTOR) ) ?
                    True : False;
}
static TRUE_FALSE   UseDBOP(void)
{
   return  UseDBCO() ;
}
static TRUE_FALSE   UseDBTC(void)
{
   return  ( GetDetectorType(BACK) == TCD ) ? True : False;
}
static TRUE_FALSE   UseDBNE(void)
{
   return  ( (GetDetectorType(BACK)==ECD) && EpcDetector(pBACK_DETECTOR) ) ?
                  True : False;
}
static TRUE_FALSE   UseDBNU(void)
{
   return  ( (GetDetectorType(BACK)==uECD) && EpcDetector(pBACK_DETECTOR) ) ?
                   True : False;
}
static TRUE_FALSE   UseDBNH(void)
{
   return  ( (GetDetectorType(BACK)==LDID) && EpcDetector(pBACK_DETECTOR) ) ?
                   True : False;
}
static TRUE_FALSE   UseDBEC(void)
{
   return  ( GetDetectorType(BACK) == ECD ) ? True : False;
}
static TRUE_FALSE   UseDBNN(void)
{
   return  ( (GetDetectorType(BACK)==NPD) && EpcDetector(pBACK_DETECTOR) ) ?
                     True : False;
}
static TRUE_FALSE   UseDBNP(void)
{
   return  ( GetDetectorType(BACK) == NPD ) ? True : False;
}
static TRUE_FALSE   UseDBNF(void)
{
   return  ( (GetDetectorType(BACK)==FPD) && EpcDetector(pBACK_DETECTOR) ) ?
                     True : False;
}
static TRUE_FALSE   UseDBFP(void)
{
   return  ( GetDetectorType(BACK) == FPD ) ? True : False;
}
static TRUE_FALSE   UseDBAI(void)
{
   if ( GetDetectorType(BACK ) == AIB ) return True ;
   if ( (GetDetectorType(BACK )==OEM_AIB) || (GetDetectorType(BACK )==OEM_FID) )
   {
      return (TRUE_FALSE)(DetectorB_Config.host_model == TYPE_13_14_AS_AIB ) ;
   };
   return False;
}

static TRUE_FALSE   UseDBEI(void)
{
   return  ( GetElectrometerType(BACK) ) ? True : False;
}

static TRUE_FALSE   UseDBUE(void)
{
   return  ( GetDetectorType(BACK) == uECD ) ? True : False;
}

static TRUE_FALSE   UseDBHI(void)
{
   return  ( GetDetectorType(BACK) == LDID ) ? True : False;
}

/*********************** AUX COMMANDS ************************/
static TRUE_FALSE   UseA1TR(void)
{
   return  ( GetAuxType(1) != NO_AUX ) ? True : False;
}
static TRUE_FALSE   UseA2TR(void)
{
   return  ( GetAuxType(2) != NO_AUX ) ? True : False;
}
static TRUE_FALSE   UseA1TZ(void)
{
   return  ( GetAuxType(1) != NO_AUX ) ? True : False;
}
static TRUE_FALSE   UseA2TZ(void)
{
   return  ( GetAuxType(2) != NO_AUX ) ? True : False;
}
static TRUE_FALSE   UseA1CR(void)
{
   return  ( (TRUE_FALSE)GetCryoPresence( pAUX_1_TEMP ) );
}
static TRUE_FALSE   UseA2CR(void)
{
   return  ( (TRUE_FALSE)GetCryoPresence( pAUX_2_TEMP ) );
}
static TRUE_FALSE   UseA3PR(void)
{
   return  ( PneuAuxPresent() == (BIT8)True) ? True : False;
}
static TRUE_FALSE   UseA4PR(void)
{
   return  ( PneuAuxPresent() == (BIT8)True) ? True : False;
}
static TRUE_FALSE   UseA5PR(void)
{
   return  ( PneuAuxPresent() == (BIT8)True) ? True : False;
}

/********************** COLUMN COMMANDS **********************/
static TRUE_FALSE   UseC1NR(void)
{
   return  ( EpcSource( pCOLUMN_1 ) ) ? True : False;
}
static TRUE_FALSE   UseC2NR(void)
{
   return ( EpcSource( pCOLUMN_2 ) ) ? True : False;
}
static TRUE_FALSE   UseIFNZ(void)
{
   return True;
}
static TRUE_FALSE   UseIBNZ(void)
{
   return True;
}

static TRUE_FALSE   UseDFNZ(void)
{
#if 0
   if ( (GetDetectorType(FRONT)==OEM_AIB) || (GetDetectorType(FRONT)==OEM_FID) )
   {
      return (TRUE_FALSE)(DetectorA_Config.host_model == TYPE_13_14_AS_IS ) ;
   };
#endif

   return True;

}

static TRUE_FALSE   UseDBNZ(void)
{
#if 0
   if ( (GetDetectorType(BACK )==OEM_AIB) || (GetDetectorType(BACK )==OEM_FID) )
   {
      return (TRUE_FALSE)(DetectorB_Config.host_model == TYPE_13_14_AS_IS ) ;
   };
#endif

   return True;
}
static TRUE_FALSE   UseA3NZ(void)
{
   return  ( PneuAuxPresent() == (BIT8)True) ? True : False;
}
static TRUE_FALSE   UseA4NZ(void)
{
   return  ( PneuAuxPresent() == (BIT8)True) ? True : False;
}
static TRUE_FALSE   UseA5NZ(void)
{
   return  ( PneuAuxPresent() == (BIT8)True) ? True : False;
}

/********************* SINGLE COLUMN COMP ********************/
static TRUE_FALSE   UseCCC1(void)
{
   return True;
}
static TRUE_FALSE   UseCCC2(void)
{
   return True;
}

/*********************** PRESSURE UNITS **********************/
static TRUE_FALSE   UseGCPU(void)
{
   return True;
}

/********************** SIGNAL COMMANDS **********************/
static TRUE_FALSE   UseS1CS(void)
{
   return True;
}
static TRUE_FALSE   UseS1CA(void)
{
   return True;
}
static TRUE_FALSE   UseS1ZA(void)
{
   return True;
}
static TRUE_FALSE   UseS2CS(void)
{
   return True;
}
static TRUE_FALSE   UseS2CA(void)
{
   return True;
}
static TRUE_FALSE   UseS2ZA(void)
{
   return True;
}
      /**** OVEN COMMANDS ****/
static TRUE_FALSE   UseOVTR(void)
{
   return True;
}
static TRUE_FALSE   UseOVTZ(void)
{
   return True;
}
static TRUE_FALSE   UseOVSP(void)
{
   return True;
}
static TRUE_FALSE   UseOVCR(void)
{
   return (GetCryoPresence( pOVEN_TEMP ) == TRUE) ? True : False;
}
static TRUE_FALSE   UseIFCR(void)
{
   return (GetCryoPresence( pFRONT_INLET_TEMP ) == TRUE) ? True : False;
}
static TRUE_FALSE   UseIBCR(void)
{
   return (GetCryoPresence( pBACK_INLET_TEMP ) == TRUE) ? True : False;
}

/********************** POSTRUN COMMANDS *********************/
static TRUE_FALSE   UseGCPO(void)
{
   return True;
}

/*********************** VALVE COMMANDS **********************/
static TRUE_FALSE   UseV1MP(void)
{
   return  ( GetValveType(1) == MULTIPOSITION ) ? True : False;
}
static TRUE_FALSE   UseV2MP(void)
{
   return  ( GetValveType(2) == MULTIPOSITION ) ? True : False;
}
static TRUE_FALSE   UseV3MP(void)
{
   return  ( GetValveType(3) == MULTIPOSITION ) ? True : False;
}
static TRUE_FALSE   UseV4MP(void)
{
   return  ( GetValveType(4) == MULTIPOSITION ) ? True : False;
}
static TRUE_FALSE   UseV5MP(void)
{
   return  ( GetValveType(5) == MULTIPOSITION ) ? True : False;
}
static TRUE_FALSE   UseV6MP(void)
{
   return  ( GetValveType(6) == MULTIPOSITION ) ? True : False;
}
static TRUE_FALSE   UseV7MP(void)
{
   return  ( GetValveType(7) == MULTIPOSITION ) ? True : False;
}
static TRUE_FALSE   UseV8MP(void)
{
   return  ( GetValveType(8) == MULTIPOSITION ) ? True : False;
}
static TRUE_FALSE   UseV1GS(void)
{
   return  ( GetValveType(1) == GAS_SAMPLING ) ? True : False;
}
static TRUE_FALSE   UseV2GS(void)
{
   return  ( GetValveType(2) == GAS_SAMPLING ) ? True : False;
}
static TRUE_FALSE   UseV3GS(void)
{
   return  ( GetValveType(3) == GAS_SAMPLING ) ? True : False;
}
static TRUE_FALSE   UseV4GS(void)
{
   return  ( GetValveType(4) == GAS_SAMPLING ) ? True : False;
}
static TRUE_FALSE   UseV5GS(void)
{
   return  ( GetValveType(5) == GAS_SAMPLING ) ? True : False;
}
static TRUE_FALSE   UseV6GS(void)
{
   return  ( GetValveType(6) == GAS_SAMPLING ) ? True : False;
}
static TRUE_FALSE   UseV7GS(void)
{
   return  ( GetValveType(7) == GAS_SAMPLING ) ? True : False;
}
static TRUE_FALSE   UseV8GS(void)
{
   return  ( GetValveType(8) == GAS_SAMPLING ) ? True : False;
}
static TRUE_FALSE   UseV1SW(void)
{
   return  ((GetValveType(1) == SELECTION) ||(GetValveType(1) == OTHER)) ?
                  True : False;
}
static TRUE_FALSE   UseV2SW(void)
{
   return  ((GetValveType(2) == SELECTION) ||(GetValveType(2) == OTHER)) ?
                  True : False;
}
static TRUE_FALSE   UseV3SW(void)
{
   return  ((GetValveType(3) == SELECTION) ||(GetValveType(3) == OTHER)) ?
                  True : False;
}
static TRUE_FALSE   UseV4SW(void)
{
   return  ((GetValveType(4) == SELECTION) ||(GetValveType(4) == OTHER)) ?
                  True : False;
}
static TRUE_FALSE   UseV5SW(void)
{
   return  ((GetValveType(5) == SELECTION) ||(GetValveType(5) == OTHER)) ?
                  True : False;
}
static TRUE_FALSE   UseV6SW(void)
{
   return  ((GetValveType(6) == SELECTION) ||(GetValveType(6) == OTHER)) ?
                  True : False;
}
static TRUE_FALSE   UseV7SW(void)
{
   return  ((GetValveType(7) == SELECTION) ||(GetValveType(7) == OTHER)) ?
                  True : False;
}
static TRUE_FALSE   UseV8SW(void)
{
   return  ((GetValveType(8) == SELECTION) ||(GetValveType(8) == OTHER)) ?
                  True : False;
}

/************************* RUN TABLE *************************/
static TRUE_FALSE   UseGCRD(void)
{
   return True;
}
static TRUE_FALSE   UseGCRa(void)
{
   return  (NumRunTableEntries() >= 1) ? True : False;
}
static TRUE_FALSE   UseGCRb(void)
{
   return  (NumRunTableEntries() >= 2) ? True : False;
}
static TRUE_FALSE   UseGCRc(void)
{
   return  (NumRunTableEntries() >= 3) ? True : False;
}
static TRUE_FALSE   UseGCRd(void)
{
   return  (NumRunTableEntries() >= 4) ? True : False;
}
static TRUE_FALSE   UseGCRe(void)
{
   return  (NumRunTableEntries() >= 5) ? True : False;
}
static TRUE_FALSE   UseGCRf(void)
{
   return  (NumRunTableEntries() >= 6) ? True : False;
}
static TRUE_FALSE   UseGCRg(void)
{
   return  (NumRunTableEntries() >= 7) ? True : False;
}
static TRUE_FALSE   UseGCRh(void)
{
   return  (NumRunTableEntries() >= 8) ? True : False;
}
static TRUE_FALSE   UseGCRi(void)
{
   return  (NumRunTableEntries() >= 9) ? True : False;
}
static TRUE_FALSE   UseGCRj(void)
{
   return  (NumRunTableEntries() >= 10) ? True : False;
}
static TRUE_FALSE   UseGCRk(void)
{
   return  (NumRunTableEntries() >= 11) ? True : False;
}
static TRUE_FALSE   UseGCRl(void)
{
   return  (NumRunTableEntries() >= 12) ? True : False;
}
static TRUE_FALSE   UseGCRm(void)
{
   return  (NumRunTableEntries() >= 13) ? True : False;
}
static TRUE_FALSE   UseGCRn(void)
{
   return  (NumRunTableEntries() >= 14) ? True : False;
}
static TRUE_FALSE   UseGCRo(void)
{
   return  (NumRunTableEntries() >= 15) ? True : False;
}
static TRUE_FALSE   UseGCRp(void)
{
   return  (NumRunTableEntries() >= 16) ? True : False;
}
static TRUE_FALSE   UseGCRq(void)
{
   return  (NumRunTableEntries() >= 17) ? True : False;
}
static TRUE_FALSE   UseGCRr(void)
{
   return  (NumRunTableEntries() >= 18) ? True : False;
}
static TRUE_FALSE   UseGCRs(void)
{
   return  (NumRunTableEntries() >= 19) ? True : False;
}
static TRUE_FALSE   UseGCRt(void)
{
   return  (NumRunTableEntries() >= 20) ? True : False;
}
static TRUE_FALSE   UseGCRu(void)
{
   return  (NumRunTableEntries() >= 21) ? True : False;
}
static TRUE_FALSE   UseGCRv(void)
{
   return  (NumRunTableEntries() >= 22) ? True : False;
}
static TRUE_FALSE   UseGCRw(void)
{
   return  (NumRunTableEntries() >= 23) ? True : False;
}
static TRUE_FALSE   UseGCRx(void)
{
   return  (NumRunTableEntries() >= 24) ? True : False;
}
static TRUE_FALSE   UseGCRy(void)
{
   return  (NumRunTableEntries() >= 25) ? True : False;
}

/*********************** ALS Setpoints ***********************/

static TRUE_FALSE   UseASTW(void)
{
   return True;
}

static TRUE_FALSE   UseASTB(void)
{
   return True;
}

static TRUE_FALSE   UseASTR(void)
{
   return True;
}
